import { request } from "@umijs/max";

///dev-api/ying/opportunity/list-all
export const getSaleList = (params?: any) => {
  return request("/api/ying/opportunity/list-all", {
    method: "GET",
    params,
  });
};
///dev-api/ying/opportunity/list-all-card
export const getSaleCardList = (params?: any) => {
  return request("/api/ying/opportunity/list-all-card", {
    method: "GET",
    params,
  });
};
// /dev-api/ying/opportunity/list-myself
export const getMySaleList = (params?: any) => {
  return request("/api/ying/opportunity/list-myself", {
    method: "GET",
    params,
  });
};
// /dev-api/ying/opportunity/list-myself-card
export const getMySaleCardList = (params?: any) => {
  return request("/api/ying/opportunity/list-myself-card", {
    method: "GET",
    params,
  });
};
// /dev-api/ying/opportunity/list-related
export const getRelatedSaleList = (params?: any) => {
  return request("/api/ying/opportunity/list-related", {
    method: "GET",
    params,
  });
};
///dev-api/ying/opportunity/list-related-card
export const getRelatedSaleCardList = (params?: any) => {
  return request("/api/ying/opportunity/list-related-card", {
    method: "GET",
    params,
  });
};
///dev-api/ying/opportunity/add
export const addSale = (data: any) => {
  return request("/api/ying/opportunity/add", {
    method: "POST",
    data,
  });
};
// /dev-api/ying/opportunity/delete/{id}
export const deleteSale = (id: number) => {
  return request(`/api/ying/opportunity/delete/${id}`, {
    method: "DELETE",
  });
};
//
// ​/dev-api​/ying​/opportunity​/detail​/{id}获取商机详细信息
export const getSaleDetail = (id: number) => {
  return request(`/api/ying/opportunity/detail/${id}`, {
    method: "GET",
  });
};
// /dev-api/ying/opportunity/edit
export const updateSale = (data: any) => {
  return request("/api/ying/opportunity/edit", {
    method: "PUT",
    data,
  });
};
// /dev-api/ying/oppo-log/add
export const addSaleLog = (data: any) => {
  return request("/api/ying/oppo-log/add", {
    method: "POST",
    data,
  });
};

//GET​/dev-api​/ying​/oppo-log​/list日志管理-列表
export const getSaleLogList = (params: any) => {
  return request("/api/ying/oppo-log/list", {
    method: "GET",
    params,
  });
};
//  ​/dev-api​/ying​/oppo-log​/simple-list
export const getSaleLogSimpleList = (params: any) => {
  return request("/api/ying/oppo-log/simple-list", {
    method: "GET",
    params,
  });
};
///dev-api/ying/oppo-log/detail/{id}
export const getSaleLogDetail = (id: number) => {
  return request(`/api/ying/oppo-log/detail/${id}`, {
    method: "GET",
  });
};
